/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author LYS
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { CqBasicModel, Page, TreeDataModel } from '/@/api/model/baseModel';

const { adminPath } = useGlobSetting();

export interface QueslibPlan extends CqBasicModel<QueslibPlan> {
  ccontent?: string; // 内容
  cstatus?: string; // 状态
  createTime?: string; // 创建时间
  updateTime?: string; // 更新时间
  auditBy?: string; // 确认人
  cversion?: string; // 版本
}

export const queslibPlanList = (params?: QueslibPlan | any) =>
  defHttp.get<QueslibPlan>({ url: adminPath + '/queslib/plan/queslibPlan/list', params });

export const queslibPlanListData = (params?: QueslibPlan | any) =>
  defHttp.post<Page<QueslibPlan>>({
    url: adminPath + '/queslib/plan/queslibPlan/listData',
    params,
  });

export const queslibPlanForm = (params?: QueslibPlan | any) =>
  defHttp.get<QueslibPlan>({ url: adminPath + '/queslib/plan/queslibPlan/form', params });

export const queslibPlanSave = (params?: any, data?: QueslibPlan | any) =>
  defHttp.postJson<QueslibPlan>({
    url: adminPath + '/queslib/plan/queslibPlan/save',
    params,
    data,
  });

export const queslibPlanDelete = (params?: QueslibPlan | any) =>
  defHttp.get<QueslibPlan>({ url: adminPath + '/queslib/plan/queslibPlan/delete', params });

export const queslibPlanConfirm = (params?: any, data?: QueslibPlan | any) =>
  defHttp.postJson<QueslibPlan>({
    url: adminPath + '/queslib/plan/queslibPlan/confirm',
    params,
    data,
  });
export const planTreeData = (params?: any) =>
  defHttp.get<TreeDataModel[]>({ url: adminPath + '/queslib/plan/queslibPlan/treeData', params });
